#import "UIColor+HexColor.h"
#import "AppDelegate.h"

///适配
//获取屏幕的高度
#define SCREEN_HEIGHT       [[UIScreen mainScreen] bounds].size.height
//获取屏幕的宽度
#define SCREEN_WIDTH        [[UIScreen mainScreen] bounds].size.width
///判断是否是iPhone X 类型的屏幕
#define IPHONE_X_TYPE       (((int)((SCREEN_HEIGHT/SCREEN_WIDTH)*100) == 216)?YES:NO)
///导航栏的高度
#define NAV_HEIGHT          ((IPHONE_X_TYPE) ? 88 : 64)
///底部距离安全区的距离
#define SAFE_TOP_HEIGHT  ((IPHONE_X_TYPE) ? 44 : 20)
///底部距离安全区的距离
#define SAFE_BOTTIM_HEIGHT  ((IPHONE_X_TYPE) ? 34 : 0)
////底部导航栏高度
#define Tabbar_Height ((IPHONE_X_TYPE == YES) ? 83.0 : 49.0)
//底部安全距离 x系列手机适配 加30dp
#define SafeAreaBottomHeight ((SCREEN_HEIGHT >= 812.0) && [[UIDevice currentDevice].model isEqualToString:@"iPhone"]  ? 30 : 0)

/////////////////////////
/////////////////////////
///颜色
#define HEXCOLOR(hexString) [UIColor colorWithHexColor:hexString]
///RGB
#define RGBColor(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1]
///主颜色
#define MAINCOLOR     HEXCOLOR(@"287EFF")
///常用颜色
///黑色
#define DARKCOLOR     HEXCOLOR(@"000000")
///白色
#define WHITECOLOR    HEXCOLOR(@"FFFFFF")
///常用背景色
#define FFIVECOLOR    HEXCOLOR(@"#FCF6F1")
///常用背景色
#define LINECOLOR    HEXCOLOR(@"#CCCCCC")
///透明
#define CLEARCOLOR    [UIColor clearColor]
//随机色
#define  XYRANDOM_COLOR [UIColor colorWithRed:(arc4random_uniform(256))/255.0 green:(arc4random_uniform(256))/255.0 blue:(arc4random_uniform(256))/255.0 alpha:1]

///常用
///默认头像
#define KDEFAULTICON [UIImage imageNamed:@"defaultIcon"]
///图片加载失败默认图片
#define kLongDefault [UIImage imageNamed:@"longDefault"]
///url 图片
#define URLWithString(string) [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",imgBaseURL,string]]
///VC纯跳转
#define PUSH_TO_VC(string) \
do { \
    UIViewController *vc = [NSClassFromString( (string) ) new]; \
    vc.hidesBottomBarWhenPushed = YES; \
    [self.navigationController pushViewController:vc animated:YES]; \
} while(NO);

///获取AppDelegate的对象
#define APPDELEGATE         (AppDelegate *)[UIApplication sharedApplication].delegate
///字体大小
#define KFOUNT(f) [UIFont systemFontOfSize:f]
///系统keyWindow
#define KKEYWINDOW [UIApplication sharedApplication].keyWindow
///获取userDefaults对象
#define USERDEFAUITS  [NSUserDefaults standardUserDefaults]
///当前VC
#define CURRENTVC [Utils getCurrentVC]
///强弱引用
#define WeakSelf(type) __weak __typeof__(type) weakSelf = type;
#define StrongSelf(type) __strong __typeof__(type) strongSelf = type;

#define isFirst @"isFirst"


#pragma mark--- 打印
//打印调试
#ifdef DEBUG
#define DMLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define DMLog(...)
#endif
